home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip Kasım 2000.iso / prog / share / 11 / setup.exe / %MAINDIR% / DEMOS / CIMIME / MIMEMULT / frmMain.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-09-07  |  21.4 KB  |  686 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "MIME Multithreaded Demonstration"
  4.    ClientHeight    =   6405
  5.    ClientLeft      =   1635
  6.    ClientTop       =   810
  7.    ClientWidth     =   7095
  8.    ControlBox      =   0   'False
  9.    Height          =   6810
  10.    Left            =   1575
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   6405
  15.    ScaleWidth      =   7095
  16.    Top             =   465
  17.    Width           =   7215
  18.    Begin VB.TextBox txtOutputPath 
  19.       BackColor       =   &H00C0C0C0&
  20.       Height          =   285
  21.       Left            =   1680
  22.       Locked          =   -1  'True
  23.       TabIndex        =   37
  24.       TabStop         =   0   'False
  25.       Top             =   5400
  26.       Width           =   4815
  27.    End
  28.    Begin VB.CheckBox Finished 
  29.       Height          =   255
  30.       Index           =   9
  31.       Left            =   6600
  32.       TabIndex        =   34
  33.       TabStop         =   0   'False
  34.       Top             =   4560
  35.       Width           =   255
  36.    End
  37.    Begin VB.CheckBox Finished 
  38.       Height          =   255
  39.       Index           =   8
  40.       Left            =   6600
  41.       TabIndex        =   33
  42.       TabStop         =   0   'False
  43.       Top             =   4200
  44.       Width           =   255
  45.    End
  46.    Begin VB.CheckBox Finished 
  47.       Height          =   255
  48.       Index           =   7
  49.       Left            =   6600
  50.       TabIndex        =   32
  51.       TabStop         =   0   'False
  52.       Top             =   3840
  53.       Width           =   255
  54.    End
  55.    Begin VB.CheckBox Finished 
  56.       Height          =   255
  57.       Index           =   6
  58.       Left            =   6600
  59.       TabIndex        =   31
  60.       TabStop         =   0   'False
  61.       Top             =   3480
  62.       Width           =   255
  63.    End
  64.    Begin VB.CheckBox Finished 
  65.       Height          =   255
  66.       Index           =   5
  67.       Left            =   6600
  68.       TabIndex        =   30
  69.       TabStop         =   0   'False
  70.       Top             =   3120
  71.       Width           =   255
  72.    End
  73.    Begin VB.CheckBox Finished 
  74.       Height          =   255
  75.       Index           =   4
  76.       Left            =   6600
  77.       TabIndex        =   29
  78.       TabStop         =   0   'False
  79.       Top             =   2760
  80.       Width           =   255
  81.    End
  82.    Begin VB.CheckBox Finished 
  83.       Height          =   255
  84.       Index           =   3
  85.       Left            =   6600
  86.       TabIndex        =   28
  87.       TabStop         =   0   'False
  88.       Top             =   2400
  89.       Width           =   255
  90.    End
  91.    Begin VB.CheckBox Finished 
  92.       Height          =   255
  93.       Index           =   2
  94.       Left            =   6600
  95.       TabIndex        =   27
  96.       TabStop         =   0   'False
  97.       Top             =   2040
  98.       Width           =   255
  99.    End
  100.    Begin VB.CheckBox Finished 
  101.       Height          =   255
  102.       Index           =   1
  103.       Left            =   6600
  104.       TabIndex        =   26
  105.       TabStop         =   0   'False
  106.       Top             =   1680
  107.       Width           =   255
  108.    End
  109.    Begin VB.CheckBox Finished 
  110.       Height          =   255
  111.       Index           =   0
  112.       Left            =   6600
  113.       TabIndex        =   25
  114.       TabStop         =   0   'False
  115.       Top             =   1320
  116.       Width           =   255
  117.    End
  118.    Begin VB.CommandButton cmdQuit 
  119.       Caption         =   "Quit"
  120.       Height          =   375
  121.       Left            =   5040
  122.       TabIndex        =   2
  123.       Top             =   5880
  124.       Width           =   1455
  125.    End
  126.    Begin VB.CommandButton cmdStart 
  127.       Caption         =   "Start"
  128.       Height          =   375
  129.       Left            =   3480
  130.       TabIndex        =   1
  131.       Top             =   5880
  132.       Width           =   1455
  133.    End
  134.    Begin VB.TextBox txtSourceFilename 
  135.       BackColor       =   &H00C0C0C0&
  136.       ForeColor       =   &H00000000&
  137.       Height          =   285
  138.       Left            =   1680
  139.       Locked          =   -1  'True
  140.       TabIndex        =   0
  141.       TabStop         =   0   'False
  142.       Text            =   "Click the ""Start"" button to be prompted for a source filename."
  143.       Top             =   5040
  144.       Width           =   4815
  145.    End
  146.    Begin VB.TextBox Text 
  147.       BackColor       =   &H00C0C0C0&
  148.       ForeColor       =   &H00000000&
  149.       Height          =   285
  150.       Index           =   9
  151.       Left            =   240
  152.       Locked          =   -1  'True
  153.       TabIndex        =   22
  154.       TabStop         =   0   'False
  155.       Top             =   4560
  156.       Width           =   2895
  157.    End
  158.    Begin VB.TextBox Text 
  159.       BackColor       =   &H00C0C0C0&
  160.       ForeColor       =   &H00000000&
  161.       Height          =   285
  162.       Index           =   8
  163.       Left            =   240
  164.       Locked          =   -1  'True
  165.       TabIndex        =   21
  166.       TabStop         =   0   'False
  167.       Top             =   4200
  168.       Width           =   2895
  169.    End
  170.    Begin VB.TextBox Text 
  171.       BackColor       =   &H00C0C0C0&
  172.       ForeColor       =   &H00000000&
  173.       Height          =   285
  174.       Index           =   7
  175.       Left            =   240
  176.       Locked          =   -1  'True
  177.       TabIndex        =   20
  178.       TabStop         =   0   'False
  179.       Top             =   3840
  180.       Width           =   2895
  181.    End
  182.    Begin VB.TextBox Text 
  183.       BackColor       =   &H00C0C0C0&
  184.       ForeColor       =   &H00000000&
  185.       Height          =   285
  186.       Index           =   6
  187.       Left            =   240
  188.       Locked          =   -1  'True
  189.       TabIndex        =   19
  190.       TabStop         =   0   'False
  191.       Top             =   3480
  192.       Width           =   2895
  193.    End
  194.    Begin VB.TextBox Text 
  195.       BackColor       =   &H00C0C0C0&
  196.       ForeColor       =   &H00000000&
  197.       Height          =   285
  198.       Index           =   5
  199.       Left            =   240
  200.       Locked          =   -1  'True
  201.       TabIndex        =   18
  202.       TabStop         =   0   'False
  203.       Top             =   3120
  204.       Width           =   2895
  205.    End
  206.    Begin VB.TextBox Text 
  207.       BackColor       =   &H00C0C0C0&
  208.       ForeColor       =   &H00000000&
  209.       Height          =   285
  210.       Index           =   4
  211.       Left            =   240
  212.       Locked          =   -1  'True
  213.       TabIndex        =   17
  214.       TabStop         =   0   'False
  215.       Top             =   2760
  216.       Width           =   2895
  217.    End
  218.    Begin VB.TextBox Text 
  219.       BackColor       =   &H00C0C0C0&
  220.       ForeColor       =   &H00000000&
  221.       Height          =   285
  222.       Index           =   3
  223.       Left            =   240
  224.       Locked          =   -1  'True
  225.       TabIndex        =   16
  226.       TabStop         =   0   'False
  227.       Top             =   2400
  228.       Width           =   2895
  229.    End
  230.    Begin VB.TextBox Text 
  231.       BackColor       =   &H00C0C0C0&
  232.       ForeColor       =   &H00000000&
  233.       Height          =   285
  234.       Index           =   2
  235.       Left            =   240
  236.       Locked          =   -1  'True
  237.       TabIndex        =   15
  238.       TabStop         =   0   'False
  239.       Top             =   2040
  240.       Width           =   2895
  241.    End
  242.    Begin VB.TextBox Text 
  243.       BackColor       =   &H00C0C0C0&
  244.       ForeColor       =   &H00000000&
  245.       Height          =   285
  246.       Index           =   1
  247.       Left            =   240
  248.       Locked          =   -1  'True
  249.       TabIndex        =   14
  250.       TabStop         =   0   'False
  251.       Top             =   1680
  252.       Width           =   2895
  253.    End
  254.    Begin VB.TextBox Text 
  255.       BackColor       =   &H00C0C0C0&
  256.       ForeColor       =   &H00000000&
  257.       Height          =   285
  258.       Index           =   0
  259.       Left            =   240
  260.       Locked          =   -1  'True
  261.       TabIndex        =   13
  262.       TabStop         =   0   'False
  263.       Top             =   1320
  264.       Width           =   2895
  265.    End
  266.    Begin VB.Label lblOutputPath 
  267.       Alignment       =   1  'Right Justify
  268.       Caption         =   "Output Path:"
  269.       Height          =   255
  270.       Left            =   240
  271.       TabIndex        =   38
  272.       Top             =   5400
  273.       Width           =   1335
  274.    End
  275.    Begin VB.Label lblEncodingProgress 
  276.       Caption         =   "Encoding Progress:"
  277.       Height          =   255
  278.       Left            =   3240
  279.       TabIndex        =   36
  280.       Top             =   1080
  281.       Width           =   1575
  282.    End
  283.    Begin VB.Label lblEncodedFilename 
  284.       Caption         =   "Encoded Filename:"
  285.       Height          =   255
  286.       Left            =   240
  287.       TabIndex        =   35
  288.       Top             =   1080
  289.       Width           =   1575
  290.    End
  291.    Begin VB.Line TopLine 
  292.       BorderColor     =   &H00000000&
  293.       BorderWidth     =   3
  294.       X1              =   240
  295.       X2              =   6840
  296.       Y1              =   120
  297.       Y2              =   120
  298.    End
  299.    Begin VB.Label lblInfo 
  300.       Caption         =   $"frmMain.frx":0000
  301.       BeginProperty Font 
  302.          name            =   "MS Sans Serif"
  303.          charset         =   0
  304.          weight          =   400
  305.          size            =   9.75
  306.          underline       =   0   'False
  307.          italic          =   0   'False
  308.          strikethrough   =   0   'False
  309.       EndProperty
  310.       ForeColor       =   &H00000000&
  311.       Height          =   735
  312.       Left            =   240
  313.       TabIndex        =   24
  314.       Top             =   240
  315.       Width           =   6255
  316.    End
  317.    Begin VB.Label lblSourceFilename 
  318.       Alignment       =   1  'Right Justify
  319.       Caption         =   "Source Filename:"
  320.       Height          =   255
  321.       Left            =   240
  322.       TabIndex        =   23
  323.       Top             =   5040
  324.       Width           =   1335
  325.    End
  326.    Begin ComctlLib.ProgressBar ProgressBar 
  327.       Height          =   255
  328.       Index           =   9
  329.       Left            =   3240
  330.       TabIndex        =   12
  331.       Top             =   4560
  332.       Width           =   3255
  333.       _Version        =   65536
  334.       _ExtentX        =   5741
  335.       _ExtentY        =   450
  336.       _StockProps     =   192
  337.       Appearance      =   1
  338.    End
  339.    Begin ComctlLib.ProgressBar ProgressBar 
  340.       Height          =   255
  341.       Index           =   8
  342.       Left            =   3240
  343.       TabIndex        =   11
  344.       Top             =   4200
  345.       Width           =   3255
  346.       _Version        =   65536
  347.       _ExtentX        =   5741
  348.       _ExtentY        =   450
  349.       _StockProps     =   192
  350.       Appearance      =   1
  351.    End
  352.    Begin ComctlLib.ProgressBar ProgressBar 
  353.       Height          =   255
  354.       Index           =   7
  355.       Left            =   3240
  356.       TabIndex        =   10
  357.       Top             =   3840
  358.       Width           =   3255
  359.       _Version        =   65536
  360.       _ExtentX        =   5741
  361.       _ExtentY        =   450
  362.       _StockProps     =   192
  363.       Appearance      =   1
  364.    End
  365.    Begin ComctlLib.ProgressBar ProgressBar 
  366.       Height          =   255
  367.       Index           =   6
  368.       Left            =   3240
  369.       TabIndex        =   9
  370.       Top             =   3480
  371.       Width           =   3255
  372.       _Version        =   65536
  373.       _ExtentX        =   5741
  374.       _ExtentY        =   450
  375.       _StockProps     =   192
  376.       Appearance      =   1
  377.    End
  378.    Begin ComctlLib.ProgressBar ProgressBar 
  379.       Height          =   255
  380.       Index           =   5
  381.       Left            =   3240
  382.       TabIndex        =   8
  383.       Top             =   3120
  384.       Width           =   3255
  385.       _Version        =   65536
  386.       _ExtentX        =   5741
  387.       _ExtentY        =   450
  388.       _StockProps     =   192
  389.       Appearance      =   1
  390.    End
  391.    Begin ComctlLib.ProgressBar ProgressBar 
  392.       Height          =   255
  393.       Index           =   4
  394.       Left            =   3240
  395.       TabIndex        =   7
  396.       Top             =   2760
  397.       Width           =   3255
  398.       _Version        =   65536
  399.       _ExtentX        =   5741
  400.       _ExtentY        =   450
  401.       _StockProps     =   192
  402.       Appearance      =   1
  403.    End
  404.    Begin ComctlLib.ProgressBar ProgressBar 
  405.       Height          =   255
  406.       Index           =   3
  407.       Left            =   3240
  408.       TabIndex        =   6
  409.       Top             =   2400
  410.       Width           =   3255
  411.       _Version        =   65536
  412.       _ExtentX        =   5741
  413.       _ExtentY        =   450
  414.       _StockProps     =   192
  415.       Appearance      =   1
  416.    End
  417.    Begin ComctlLib.ProgressBar ProgressBar 
  418.       Height          =   255
  419.       Index           =   2
  420.       Left            =   3240
  421.       TabIndex        =   5
  422.       Top             =   2040
  423.       Width           =   3255
  424.       _Version        =   65536
  425.       _ExtentX        =   5741
  426.       _ExtentY        =   450
  427.       _StockProps     =   192
  428.       Appearance      =   1
  429.    End
  430.    Begin ComctlLib.ProgressBar ProgressBar 
  431.       Height          =   255
  432.       Index           =   1
  433.       Left            =   3240
  434.       TabIndex        =   4
  435.       Top             =   1680
  436.       Width           =   3255
  437.       _Version        =   65536
  438.       _ExtentX        =   5741
  439.       _ExtentY        =   450
  440.       _StockProps     =   192
  441.       Appearance      =   1
  442.    End
  443.    Begin ComctlLib.ProgressBar ProgressBar 
  444.       Height          =   255
  445.       Index           =   0
  446.       Left            =   3240
  447.       TabIndex        =   3
  448.       Top             =   1320
  449.       Width           =   3255
  450.       _Version        =   65536
  451.       _ExtentX        =   5741
  452.       _ExtentY        =   450
  453.       _StockProps     =   192
  454.       Appearance      =   1
  455.    End
  456.    Begin CIMIMELib.CIMIME CIMIME 
  457.       Height          =   450
  458.       Index           =   9
  459.       Left            =   5880
  460.       Top             =   120
  461.       Width           =   480
  462.       _Version        =   65537
  463.       _ExtentX        =   847
  464.       _ExtentY        =   794
  465.       _StockProps     =   0
  466.       SourceFilename  =   ""
  467.       DestinationFilename=   ""
  468.    End
  469.    Begin CIMIMELib.CIMIME CIMIME 
  470.       Height          =   450
  471.       Index           =   8
  472.       Left            =   5280
  473.       Top             =   120
  474.       Width           =   480
  475.       _Version        =   65537
  476.       _ExtentX        =   847
  477.       _ExtentY        =   794
  478.       _StockProps     =   0
  479.       SourceFilename  =   ""
  480.       DestinationFilename=   ""
  481.    End
  482.    Begin CIMIMELib.CIMIME CIMIME 
  483.       Height          =   450
  484.       Index           =   7
  485.       Left            =   4680
  486.       Top             =   120
  487.       Width           =   480
  488.       _Version        =   65537
  489.       _ExtentX        =   847
  490.       _ExtentY        =   794
  491.       _StockProps     =   0
  492.       SourceFilename  =   ""
  493.       DestinationFilename=   ""
  494.    End
  495.    Begin CIMIMELib.CIMIME CIMIME 
  496.       Height          =   450
  497.       Index           =   6
  498.       Left            =   4080
  499.       Top             =   120
  500.       Width           =   480
  501.       _Version        =   65537
  502.       _ExtentX        =   847
  503.       _ExtentY        =   794
  504.       _StockProps     =   0
  505.       SourceFilename  =   ""
  506.       DestinationFilename=   ""
  507.    End
  508.    Begin CIMIMELib.CIMIME CIMIME 
  509.       Height          =   450
  510.       Index           =   5
  511.       Left            =   3480
  512.       Top             =   120
  513.       Width           =   480
  514.       _Version        =   65537
  515.       _ExtentX        =   847
  516.       _ExtentY        =   794
  517.       _StockProps     =   0
  518.       SourceFilename  =   ""
  519.       DestinationFilename=   ""
  520.    End
  521.    Begin CIMIMELib.CIMIME CIMIME 
  522.       Height          =   450
  523.       Index           =   4
  524.       Left            =   2880
  525.       Top             =   120
  526.       Width           =   480
  527.       _Version        =   65537
  528.       _ExtentX        =   847
  529.       _ExtentY        =   794
  530.       _StockProps     =   0
  531.       SourceFilename  =   ""
  532.       DestinationFilename=   ""
  533.    End
  534.    Begin CIMIMELib.CIMIME CIMIME 
  535.       Height          =   450
  536.       Index           =   3
  537.       Left            =   2280
  538.       Top             =   120
  539.       Width           =   480
  540.       _Version        =   65537
  541.       _ExtentX        =   847
  542.       _ExtentY        =   794
  543.       _StockProps     =   0
  544.       SourceFilename  =   ""
  545.       DestinationFilename=   ""
  546.    End
  547.    Begin CIMIMELib.CIMIME CIMIME 
  548.       Height          =   450
  549.       Index           =   2
  550.       Left            =   1680
  551.       Top             =   120
  552.       Width           =   480
  553.       _Version        =   65537
  554.       _ExtentX        =   847
  555.       _ExtentY        =   794
  556.       _StockProps     =   0
  557.       SourceFilename  =   ""
  558.       DestinationFilename=   ""
  559.    End
  560.    Begin CIMIMELib.CIMIME CIMIME 
  561.       Height          =   450
  562.       Index           =   1
  563.       Left            =   1080
  564.       Top             =   120
  565.       Width           =   480
  566.       _Version        =   65537
  567.       _ExtentX        =   847
  568.       _ExtentY        =   794
  569.       _StockProps     =   0
  570.       SourceFilename  =   ""
  571.       DestinationFilename=   ""
  572.    End
  573.    Begin CIMIMELib.CIMIME CIMIME 
  574.       Height          =   450
  575.       Index           =   0
  576.       Left            =   480
  577.       Top             =   120
  578.       Width           =   480
  579.       _Version        =   65537
  580.       _ExtentX        =   847
  581.       _ExtentY        =   794
  582.       _StockProps     =   0
  583.       SourceFilename  =   ""
  584.       DestinationFilename=   ""
  585.    End
  586. Attribute VB_Name = "frmMain"
  587. Attribute VB_Creatable = False
  588. Attribute VB_Exposed = False
  589. Dim iFileCount As Integer
  590. Private Sub CIMIME_Encoded(Index As Integer, ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesEncoded As Long)
  591.   '     Update progress bar
  592.   ProgressBar(Index).Value = BytesRead
  593. End Sub
  594. Private Sub CIMIME_EncodingFinished(Index As Integer, ByVal Error As Integer)
  595.   '     Increment the file count
  596.   iFileCount = iFileCount + 1
  597.   '     Check the finished box
  598.   Finished(Index).Value = 1
  599.   '     All files are encoded so enable buttons
  600.   If iFileCount = 10 Then
  601.     iFileCount = 0
  602.     DoEvents
  603.     MsgBox ("Encoding has finished")
  604.     txtSourceFilename.Text = ""
  605.     cmdStart.Enabled = True
  606.     cmdQuit.Enabled = True
  607.   End If
  608. End Sub
  609. Private Sub CIMIME_EncodingStarted(Index As Integer)
  610.     If Index = 0 Then
  611.         '    -   Use the same source filename for all encodes
  612.         txtSourceFilename.Text = CIMIME(0).SourceFilename
  613.         
  614.         '    -   Initiate the next 9 MIME encodes using a single source file
  615.         For iThreadCount% = 1 To 9
  616.           Text(iThreadCount%).Text = "OUTPUT" & CStr(iThreadCount%) + 1 & ".m"
  617.           CIMIME(iThreadCount%).FireStatus = True
  618.           CIMIME(iThreadCount%).ProgressDialogVisible = False
  619.           CIMIME(iThreadCount%).SourceFilename = txtSourceFilename.Text
  620.           CIMIME(iThreadCount%).DestinationFilename = txtOutputPath.Text & "\" & "OUTPUT.0" & _
  621.           CStr(iThreadCount%) + 1 & ".m"
  622.           '     MIMEEncode initiates the encoding operation
  623.           '    which causes the EncodingStarted event to
  624.           '    fire. When the encoding operation completes,
  625.           '    the EncodingFinished event fires. If you set
  626.           '    the FireStatus property to True, the Encoded
  627.           '    event fires during the decoding operation
  628.           '    (depending on the file size).
  629.           CIMIME(iThreadCount%).MIMEEncode
  630.         Next
  631.     End If
  632.   '    - Initialize progress bar to the source file size
  633.   ProgressBar(Index).Max = CIMIME(Index).SourceFileSize
  634. End Sub
  635. Private Sub cmdQuit_Click()
  636.   End
  637. End Sub
  638. Private Sub cmdStart_Click()
  639.   '     Make sure boxes are not checked
  640.   For iThreadCount% = 0 To 9
  641.     Finished(iThreadCount%).Value = 0
  642.   Next
  643.   '     Disable command buttons
  644.   cmdStart.Enabled = False
  645.   cmdQuit.Enabled = False
  646.   Text(0).Text = "OUTPUT" & CStr(iThreadCount%) + 1 & ".m"
  647.   CIMIME(0).FireStatus = True
  648.   CIMIME(0).ProgressDialogVisible = False
  649.   CIMIME(0).DestinationFilename = txtOutputPath.Text & "\" & "OUTPUT.0" & _
  650.   CStr(0) + 1 & ".m"
  651.   '     MIMEEncode initiates the encoding operation
  652.   '    which causes the EncodingStarted event to
  653.   '    fire. When the encoding operation completes,
  654.   '    the EncodingFinished event fires. If you set
  655.   '    the FireStatus property to True, the Encoded
  656.   '    event fires during the decoding operation
  657.   '    (depending on the file size).
  658.   bResult = CIMIME(0).MIMEEncode
  659.   '    - Something went wrong so restore idle state
  660.   If bResult = False Then
  661.     iFileCount = 0
  662.     DoEvents
  663.     cmdStart.Enabled = True
  664.     cmdQuit.Enabled = True
  665.     Exit Sub
  666.   End If
  667. End Sub
  668. Private Sub Form_Load()
  669.   '---------------------------------------------------------------------
  670.   ' Title:          MIME Multithreaded Demo
  671.   ' Description:    This program illustrates the multithreaded
  672.   '                 capabilities of the CIMIME control. CIMIME or
  673.   '                 CIUU enable you to easily encode or decode
  674.   '                 data in the background.
  675.   ' Author:         Stephen Casella
  676.   ' Last Revision:  May 2, 1996
  677.   '---------------------------------------------------------------------
  678.   '   center main form
  679.   frmMain.Top = Screen.Height \ 2 - frmMain.Height \ 2
  680.   frmMain.Left = Screen.Width \ 2 - frmMain.Width \ 2
  681.   '     Output path
  682.   txtOutputPath.Text = App.Path
  683.   '     Initialize variable
  684.   iFileCount = 0
  685. End Sub
  686.